from base.base import Base
from time import sleep
from selenium.webdriver.common.by import By

class SousuoPage(Base):
    fangdajing=(By.ID,'cn.xuexi.android:id/img_search_left')

    shurukuang='new UiSelector().resourceId("android:id/search_src_text")'

    fanhui=(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout[1]/android.widget.ImageView')

    dy=(By.XPATH,'//android.widget.TextView[@text="推荐"]')

    dy2=(By.XPATH,'//android.widget.TextView[@text="发现"]')

    def sousuoyewu(self,password):

        self.loc_ele(self.fangdajing).click()
        sleep(2)

        self.loc_ui_ele(self.shurukuang).send_keys(password)
        sleep(2)

        self.loc_ele(self.fanhui).click()
        sleep(2)